package com.rockcent.service;

import com.rockcent.common.common.PageResult;
import com.rockcent.mall.lib.domain.MallMember;
import com.rockcent.mall.lib.domain.MallMemberFundFlow;
import com.rockcent.mall.lib.domain.MallMemberRechargeFlow;
import com.rockcent.mall.lib.domain.enumclass.MallMemberFundTransactionType;
import com.rockcent.mall.lib.domain.enumclass.MallMemberRechargeType;
import com.rockcent.mall.lib.dto.MallMemberRechargeFlowDto;

import java.math.BigDecimal;

/**
 * Created by zhangjh on 2017/3/8.
 */
public interface MallMemberRechargeSrv {

    /**
     *
     * @param mallId
     * @return
     */
    MallMemberRechargeFlow findTop1ByMallIdOrderByLastUpdatedDesc(Long mallId);

    /**
     *
     * @param dto
     */
    void save(MallMemberRechargeFlow dto);

    /**
     *
     * @param dto
     * @param page
     * @return
     */
    PageResult<MallMemberRechargeFlowDto> findMallMemberRechargePage(MallMemberRechargeFlowDto dto, PageResult page);

    /**
     *
     * @param mallMember
     * @param transactionType
     * @param rechargeAmount
     */
    MallMemberFundFlow rechargeSingle(MallMember mallMember, String transactionType, BigDecimal rechargeAmount);
}
